package oop8;

/**
 * @author oldliu
 * @since 1.0
 */
public class Square extends Shape {
    private double width;
    private double height;

    public Square(double width, double height) {
        this.width = width;
        this.height = height;
    }

    @Override
    public double calcArea() {
        return width*height;
    }

    @Override
    public double calcPerimeter() {
        return (width+height)*2;
    }

    @Override
    public String toString() {
        return "这是长方形,长是"+width+".高是"+height;
    }
}
